/*
 * d=3
 * n=1639
 * m=1332
 * c=1.23
 * maxlen=12
 * minklen=10
 * maxklen=12
 * minchar=46
 * maxchar=122
 * loop=1
 * numiter=1
 * seed=
 */

static int g[] = {
	0, 1038, -11, 22, 0, -14, -1022, 0, 6961, -455,
	-1179, 168, 0, -374, 0, 653, 0, -939, 0, 15,
	-168, 41, 0, -9, -507, -193, -75, -5, 1358, 10,
	7, 61, 13, 22, 193, 0, 0, -1673, 21, 469,
	-87, 31, -13, 241, 0, -159, -146, -31, 491, 96,
	0, 22, -882, 0, -336, 235, 1, 60, 360, 158,
	1431, 0, -1109, 0, 1, 160, 46, 8, -1921, 0,
	-36, 292, 1864, -46, 30, -970, -223, -378, 64, 23,
	-485, 1002, -134, 338, 1, -525, -58, -219, -414, 106,
	822, 19, 0, 15, 299, -125, -740, 4, -650, 0,
	0, 15, -1657, 31, 561, 10, -402, -803, -249, 6437,
	0, -138, 88, 1967, -75, 931, -86, 932, 212, 5507,
	1095, 0, 10, 32, 0, 4, 2348, 0, 0, 988,
	-4623, -21, -589, 21, -75, 208, -2026, -38, -1470, -80,
	-340, -2107, 10, 23, -61, 7282, 10, 1983, 0, 0,
	803, 0, 0, -6225, -36, 40, -481, 5, 5636, 966,
	-31, -225, -744, -215, -821, -24, -12, 1626, 0, 0,
	205, -186, -9, 146, 27, -1387, -17, 0, 0, -88,
	-164, 1472, 259, -91, -1140, 0, 51, 124, 807, 0,
	0, 676, 8, 28, 199, -583, -43, 232, -626, -571,
	-20, 0, -3788, 430, 1667, 0, -589, -12, 93, 0,
	293, -73, -79, 0, 167, -41, 132, 0, 0, 11,
	0, -16, 15, 0, 0, 58, -639, -25, 506, -261,
	-67, 71, -14, 3, 0, 1, 22, 0, 5, 1463,
	25, 3, -300, 0, -23, 463, 97, 360, -985, -488,
	9, 920, 20, 13, 1695, 546, 1239, 56, 10, 974,
	0, 117, 21, 15, 0, 791, -22, -65, -183, -99,
	2, 277, -166, 0, 17, 2, -152, 0, 1452, -49,
	178, -329, 63, 2205, -118, 2805, 11, 369, -96, 5485,
	0, -302, -6428, -153, 21, 21, 0, -47, -93, 125,
	9, -221, 380, 0, 10, 12, 0, 229, -32, -6,
	-108, -1700, 19, -63, 37, 1281, -579, 0, 5697, 1074,
	-401, 239, 55, -54, 753, -3, 120, 12, 1070, 978,
	33, 0, 56, 2889, 85, 0, -96, 0, 0, 845,
	0, -372, 741, -41, 0, -220, 0, -543, 1592, 133,
	0, -220, -7, -168, 990, 120, 25, -2084, 1061, 10,
	-48, -908, 0, 83, 1, 461, -102, 0, 47, 498,
	0, -176, -350, -46, 0, 0, -389, -4308, 112, -29,
	12, 23, 70, -1549, 13, 56, 975, -1026, -11, 2582,
	-6, 24, -37, -909, 0, 0, 430, 274, 10, 389,
	147, -62, 99, 0, -15, 19, -910, -106, 0, 46,
	954, 0, 4, 392, 10, -1324, -1270, 0, 5, 538,
	324, 1, 10, 0, -333, 377, -362, 0, 10, 972,
	-78, 637, 0, -474, 37, 499, -44, -9, 0, -7364,
	217, 21, 43, 60, -2, -10, 256, 0, 1327, 0,
	1678, 1, -291, 22, 0, 174, 681, 27, 155, 0,
	224, 65, 0, -11, -179, 0, 0, -1848, 219, -385,
	10, 74, 67, 92, -456, -199, 44, -289, 98, -1835,
	0, -335, 0, -55, 372, 152, -1074, -10, 3827, -5469,
	-18, 248, -611, 36, -23, 0, 71, 592, -95, 4325,
	146, -27, 181, 30, -777, -157, 0, 4, -472, -603,
	-198, 38, 7, -17, -386, -6572, -364, 683, 15, 0,
	0, -38, 54, 332, -746, 6, -8, 15, 521, 0,
	-2335, 8, 7339, -14, -3555, -20, 141, -74, 0, 473,
	-105, 23, -918, -9, 0, -734, -97, 135, 0, -5,
	1, -874, -115, 789, 192, 30, 0, 0, -946, 849,
	709, 109, -624, -146, -5666, -16, 17, -22, 8, 665,
	0, 559, -265, -497, 28, 1153, 1267, -1346, 0, 10,
	-63, -179, 0, 51, 0, 0, 0, -2503, -74, 2005,
	161, 81, 0, 0, 1657, -1126, -196, -77, 194, 760,
	3, -11, 204, 0, -14, 680, 0, -50, -1137, 12,
	-22, 0, -36, 0, -183, 14, -1117, 15, 0, 15,
	-293, 33, 0, 18, -74, -107, 637, 0, -3, 359,
	-112, 7, 21, -72, -113, -2570, 118, 282, -318, 2495,
	-8, 0, -1578, 0, 0, 16, 0, -20, 28, -981,
	895, -5, -499, 0, 0, -524, 0, 647, -14, -75,
	-11, -385, 10, -321, 7377, 0, 0, -142, 0, -1076,
	-257, -280, 0, 160, 154, 0, 21, 3134, -1240, -179,
	10, 0, -218, 0, -50, -11, -30, -20, 0, 0,
	174, -12, 0, -154, 0, 0, 0, -305, -433, -118,
	0, 1049, -9, 0, -2141, 0, 11, -1064, 34, -324,
	-9, -23, -3, 7, 100, 46, 439, 0, -538, -96,
	-436, -142, -1011, -158, -335, 57, 0, 0, 0, -33,
	271, -95, 0, 54, -5486, -154, 476, -123, 1549, 41,
	473, 33, 0, 0, -833, -3, -243, -10, -473, 175,
	226, 25, -52, 0, 0, 184, 0, 352, -905, 1849,
	-14, -323, -159, 11, -184, 0, 0, -20, 0, 0,
	9, 53, 102, 239, -853, -6325, 14, 0, 0, 425,
	-186, 40, 969, 0, -446, 1159, 69, 2085, 0, 1127,
	289, 0, 74, 0, 4502, -9, 286, -56, 587, 0,
	0, 0, 0, -743, -4587, -7014, -141, -186, 1194, -1834,
	-14, 0, 0, -23, -1827, -1134, -399, 0, 1215, -832,
	0, 149, 281, 1028, -320, 63, 560, 10, 315, 1186,
	4848, 23, 5, 0, -1050, 1477, 1028, -5, 346, -898,
	-184, -1250, 295, -681, -2429, -477, 22, 0, 0, 223,
	-147, 292, 58, 13, 1667, 0, 0, 9, -49, 0,
	-8, -349, -70, -2, -1431, -159, -125, 4, -476, 160,
	26, -5567, 0, -119, -39, 0, -6, 115, -5876, 0,
	-20, 0, 0, 486, 0, 7, -95, 194, -946, -975,
	29, -41, 1, 327, 0, 30, -14, -176, 0, 0,
	-136, 459, 12, -386, 337, -2193, 793, 233, 2880, -13,
	-673, 39, -239, 543, -49, -367, -1983, -499, -12, 3,
	0, 1038, 27, 80, 1348, 48, -1315, 0, 0, 0,
	0, -52, -123, 10, 25, -8, 18, 4612, -1034, 263,
	0, 0, 23, 175, 14, 417, 0, 0, 559, 50,
	-2879, -195, 281, 0, -11, -15, 0, 24, -153, 626,
	452, 56, 212, 10, -125, -1237, 0, -66, 1057, -5525,
	350, 0, 364, 201, 1321, 0, -32, 0, -1174, 1012,
	0, 892, -105, -20, 70, 0, 2111, -1251, -1718, -1598,
	158, 1119, -490, -487, 73, 3767, 26, 46, 978, -1,
	-1499, 0, 10, -157, 193, 154, 974, 46, 0, -1751,
	-976, -2876, 152, -445, 487, 0, 0, 249, -4, -1108,
	374, -161, 0, 6502, -137, 438, 0, 0, 0, -2,
	-85, 1568, 10, 1463, 923, 56, 0, -301, -11, 173,
	352, 310, -248, -150, -1097, -1887, 250, -14, -243, 0,
	-165, -1255, 32, 144, -18, -9, 0, -131, 162, 0,
	842, 0, 22, -974, 7, -201, 1550, -31, 14, -207,
	14, 395, -1462, -514, 0, 0, 0, 25, 0, 19,
	4, 6, 164, 79, -1800, 1412, 0, 10, -53, 21,
	0, -63, 149, -297, 0, 826, -42, -281, 1, -8,
	34, -302, 3, -84, 0, 2800, 6235, -5, -1565, 356,
	484, -96, 0, 0, 0, 150, 18, -54, 85, -255,
	5, -65, 84, -428, 500, 12, 173, 1158, 0, 28,
	-357, 15, 1575, 509, -155, 509, 914, 1049, 0, 19,
	-6, 0, -441, 0, 179, -94, 440, -42, -5496, 26,
	610, 0, 11, 31, 0, 0, 201, 266, -668, 187,
	26, -349, 31, 388, 3, -68, -15, -1204, -508, 11,
	3999, -10, 25, 0, 158, 599, 0, 41, 0, -1088,
	0, 22, 0, -6964, 0, 11, 0, 39, 30, 776,
	70, 148, 22, 0, 1208, -1616, 806, -17, 5715, 334,
	-9, 946, 39, 213, -326, -23, 0, 33, 985, -1014,
	41, 0, -43, 509, 63, -93, -136, -1205, 0, 46,
	1321, 0, 26, 473, -36, 3557, 0, -18, 0, 97,
	-284, -2, 556, 0, 70, 0, 0, 0, -180, -283,
	-44, 11, 0, 357, -13, 10, -357, 0, 123, -44,
	498, -341, 0, -60, -128, 293, -11, -236, 1062, 40,
	2075, -33, 78, -6751, -36, -1029, 0, 310, 34, -1936,
	-212, 15, 304, -922, 24, 351, 427, 15, 0, 30,
	-1230, -12, -20, -4549, 402, 0, -1650, -15, -26, 338,
	163, 0, 9, 263, 0, -5558, 3, 1587, -10, -97,
	9, 0, 0, 743, 21, 300, -50, -964, -3, -1149,
	-18, 0, -1540, 12, 10, 0, 118, 0, 537, 26,
	0, 12, 1077, -1027, 272, 36, 30, 310, -40, 78,
	0, 0, 672, 0, 0, -12, 129, -367, -19, 0,
	0, -47, 25, -746, -13, 0, -1093, 38, -947, -21,
	-261, 180, -68, 0, 1082, 853, -947, 1090, 47, 739,
	-426, -42, 816, 21, 10, 0, 940, 5, -18, 98,
	10, -967, 334, 205, 0, 0, 0, 106, 6749, 141,
	-172, 0, 140, 35, 117, 15, -844, 627, 120, 4560,
	0, 110, 0, 691, -22, 25, -5, 5552, 1502, 20,
	35, 156, 173, 261, -54, -189, 936, -516, 0, 0,
	-333, 118, 2076, -27, 163, 179, 136, -96, 5500, 2076,
	-10, 0, -355, 1145, -147, 0, 0, 1480, 0, 32,
	0, -549, -14, 1, 184, 1018, 1190, 64, 1593, -36,
	375, -172, -11, -2928, 21, -20, 16, 130, 51, -362,
	26, 181, 10, 460, 118, -230, 4, 194, 74, -1215,
	0, -1657, -374, -568, 0, -267, 843, 104, -1019, -15,
	382, -1924, 0, -80, 16, -115, 26, -2220, 67, 24,
	-26, -112, 10, -958, -42, 127, 0, 0, 84, 0,
	0, 6967, 6, 1119, 22, 9, 0, 0, -3547, -119,
	0, 448, 309, 1, 0, 2088, -723, 1652, -1064, 0,
	0, 338, -16, -939, 10, 39, 24, 0, 0, -5,
	63, 1151, 0, 10, 130, -978, 271, 0, 1159, 1108,
	-60, 7, -66, -938, 0, -30, -2548, 4, -283, -3828,
	0, 1481, -33, -164, 66, -367, -11, 249, 39, -230,
	0, -237, 0, 954, -1418, -48, 0, -835, 21, 0,
	62, 0, -150, 0, -3, 0, -34, 209, 10, 41,
	-2, 97, 26, 0, -1144, -174, 24, -136, 39, 32,
	33, 1325, -88, -239, -962, 0, -131, -68, 52, 0,
	5, 280, 0, 0, 30, 22, 0, 0, -2073, 10,
	11, 24, 0, 559, 0, 2081, -126, 135, -613, -1086,
	0, -163, 166, 17, 0, -968, 2204, -6, 0, -1115,
	28, -190, -36, 968, -39, -384, 99, -499, -22, 183,
	162, 2, 0, -338, 329, 0, 0, 107, 0, 
};

static int T0[] = {
	191, 669, 271, 776, 393, 1359, 497, 926, 854, 886,
	1381, 5, 335, 1151, 1588, 1368, 433, 476, 292, 1120,
	417, 717, 697, 815, 176, 1121, 592, 1192, 638, 1187,
	1046, 541, 1568, 1318, 1030, 34, 1038, 1527, 960, 1604,
	486, 703, 1609, 821, 215, 1559, 262, 360, 108, 554,
	1193, 526, 984, 251, 1053, 872, 1372, 7, 137, 84,
	906, 1184, 337, 547, 863, 1079, 582, 1613, 679, 1254,
	1579, 1165, 30, 1549, 59, 1597, 1181, 1226, 584, 304,
	1306, 695, 685, 145, 1178, 1275, 210, 837, 1161, 254,
	127, 1001, 1049, 679, 1177, 522, 85, 1047, 280, 189,
	213, 944, 625, 296, 1070, 152, 745, 585, 1090, 1041,
	601, 470, 97, 1286, 327, 987, 635, 249, 186, 157,
	503, 25, 870, 1553, 704, 409, 148, 501, 1456, 428,
	403, 30, 1373, 1028, 38, 516, 893, 783, 813, 56,
	1536, 1415, 526, 1634, 774, 853, 694, 1409, 815, 880,
	1567, 1318, 617, 798, 1637, 279, 1569, 1487, 562, 148,
	888, 1372, 1139, 0, 187, 1581, 906, 1637, 1294, 1537,
	927, 1397, 1482, 761, 1109, 1004, 470, 875, 583, 139,
	1255, 206, 1326, 950, 1420, 1325, 1230, 1350, 1173, 153,
	1210, 134, 1237, 711, 134, 1136, 365, 1041, 1134, 1371,
	651, 423, 1129, 206, 896, 311, 1210, 1366, 898, 1505,
	1217, 226, 1424, 616, 1177, 1205, 302, 480, 628, 1187,
	345, 199, 1034, 1294, 622, 1168, 791, 988, 282, 287,
	432, 1460, 1043, 46, 732, 351, 1371, 971, 1415, 1552,
	1247, 1170, 85, 636, 254, 1346, 781, 1480, 612, 1615,
	285, 1590, 777, 1429, 506, 205, 1268, 1258, 939, 1628,
	903, 678, 1161, 19, 725, 1606, 371, 169, 938, 147,
	82, 547, 1318, 1518, 895, 1284, 1225, 37, 837, 198,
	1364, 1122, 150, 215, 624, 656, 420, 253, 1626, 1360,
	1593, 891, 111, 1116, 910, 836, 1083, 1281, 1005, 94,
	1141, 799, 353, 532, 678, 1249, 1528, 265, 1307, 253,
	479, 1076, 1460, 1439, 973, 11, 356, 756, 1342, 930,
	1242, 1059, 1217, 1421, 281, 280, 103, 748, 776, 593,
	1237, 119, 1159, 1491, 8, 661, 424, 1580, 587, 1443,
	1546, 1066, 593, 1367, 578, 1278, 1090, 934, 107, 505,
	225, 1061, 1276, 1442, 844, 1557, 1434, 947, 379, 572,
	1540, 1616, 403, 772, 1180, 411, 1145, 1316, 64, 93,
	1121, 1610, 871, 75, 1050, 1449, 1065, 214, 456, 1173,
	719, 682, 595, 69, 197, 7, 576, 811, 193, 1571,
	92, 1070, 1128, 584, 1150, 945, 1498, 667, 1397, 1122,
	353, 525, 24, 1627, 1479, 1209, 1464, 546, 1240, 933,
	1467, 137, 200, 412, 1258, 941, 131, 195, 1465, 325,
	128, 1557, 1395, 1256, 214, 618, 275, 74, 997, 33,
	908, 1350, 270, 644, 1050, 111, 215, 876, 369, 1455,
	1521, 198, 1593, 82, 322, 1212, 736, 166, 1407, 562,
	491, 1247, 480, 1598, 865, 407, 289, 1140, 481, 1287,
	885, 1101, 210, 1124, 339, 965, 170, 470, 382, 60,
	967, 1463, 698, 172, 86, 1560, 444, 831, 276, 1544,
	391, 1048, 232, 938, 184, 579, 1323, 496, 1354, 248,
	301, 848, 884, 512, 333, 1223, 1477, 503, 54, 1571,
	275, 733, 1395, 685, 906, 1482, 606, 1062, 674, 882,
	679, 1065, 3, 911, 364, 1539, 1203, 1399, 108, 630,
	1359, 409, 1478, 604, 633, 172, 188, 183, 387, 242,
	116, 374, 976, 1511, 1060, 1594, 1354, 27, 729, 1318,
	1591, 140, 426, 973, 201, 426, 205, 1251, 1310, 1108,
	648, 341, 142, 636, 503, 928, 1348, 188, 980, 940,
	932, 292, 1058, 47, 667, 592, 630, 1499, 1519, 752,
	1179, 1471, 893, 1317, 806, 1094, 104, 723, 418, 1126,
	1543, 1066, 1467, 46, 1415, 43, 687, 1124, 231, 28,
	137, 875, 320, 908, 923, 700, 1212, 1265, 560, 1092,
	90, 1451, 925, 695, 1129, 1443, 1502, 1233, 527, 281,
	721, 144, 1060, 261, 190, 836, 1313, 1407, 378, 1515,
	715, 441, 1275, 1118, 812, 1490, 801, 1580, 1154, 17,
	228, 62, 51, 302, 1392, 1545, 995, 812, 251, 388,
	148, 1052, 219, 567, 1150, 356, 814, 825, 1475, 904,
	413, 551, 1345, 1401, 30, 230, 1252, 543, 172, 480,
	560, 112, 542, 323, 414, 295, 1581, 1409, 820, 193,
	158, 680, 1245, 377, 1247, 757, 445, 422, 1294, 281,
	1038, 1419, 544, 456, 1181, 287, 687, 507, 830, 571,
	987, 1103, 683, 39, 748, 877, 1102, 466, 1015, 162,
	988, 1505, 1277, 1192, 1258, 428, 1572, 1302, 1110, 937,
	67, 261, 1347, 1419, 1319, 408, 1224, 477, 119, 1510,
	316, 1370, 562, 1027, 1121, 1310, 265, 584, 1488, 993,
	459, 549, 859, 97, 103, 190, 237, 1387, 1204, 1348,
	397, 1272, 1321, 105, 1052, 1001, 226, 637, 1479, 345,
	508, 1507, 1427, 782, 895, 909, 454, 872, 1494, 15,
	226, 26, 565, 797, 1474, 380, 988, 72, 128, 265,
	949, 148, 441, 1371, 1554, 1568, 1125, 1438, 447, 431,
	1213, 759, 346, 1162, 642, 271, 906, 1215, 258, 527,
	759, 1469, 365, 1404, 1497, 1585, 897, 1125, 363, 718,
	173, 1024, 578, 327, 468, 205, 1607, 1593, 5, 127,
	385, 1218, 886, 443, 453, 1240, 715, 1359, 817, 685,
	248, 1288, 515, 613, 1054, 85, 271, 24, 1211, 346,
	742, 1096, 1082, 1032, 1423, 1551, 1238, 1391, 1505, 955,
	1519, 1603, 534, 478, 119, 987, 80, 1327, 959, 1188,
	745, 961, 1561, 651, 1510, 1370, 686, 1041, 439, 876,
	1079, 289, 423, 1525, 330, 43, 829, 1179, 309, 579,
	231, 1276, 538, 477, 1266, 52, 936, 646, 1091, 256,
	196, 197, 1217, 1469, 560, 801, 912, 1246, 203, 1351,
	483, 994, 1352, 619, 881, 43, 662, 71, 934, 683,
	650, 878, 32, 900, 1355, 1299, 664, 652, 306, 1467,
	909, 214, 1376, 199, 44, 297, 1000, 956, 1544, 916,
	380, 100, 271, 93, 
};

static int T1[] = {
	134, 1515, 796, 1153, 1476, 1463, 1421, 1328, 528, 636,
	1594, 327, 522, 463, 1056, 262, 1054, 1289, 1445, 790,
	1630, 842, 843, 1147, 315, 339, 1422, 1065, 1450, 1488,
	577, 1296, 1364, 1373, 810, 913, 1197, 592, 314, 1438,
	940, 269, 126, 1462, 732, 894, 1436, 1498, 544, 955,
	361, 247, 1509, 916, 1395, 186, 967, 890, 963, 778,
	739, 1540, 435, 176, 1274, 957, 1089, 545, 1261, 1403,
	56, 275, 1384, 1533, 1449, 189, 789, 815, 1042, 1558,
	1452, 137, 46, 1515, 664, 1374, 1245, 65, 267, 395,
	236, 946, 938, 985, 1627, 935, 1537, 994, 1108, 1117,
	86, 100, 554, 946, 821, 353, 94, 1506, 1168, 848,
	1425, 694, 986, 1471, 570, 1362, 1206, 176, 1140, 1186,
	284, 1376, 205, 934, 722, 193, 230, 333, 1187, 1051,
	1162, 985, 863, 78, 293, 46, 431, 99, 1552, 1311,
	659, 1050, 366, 6, 595, 936, 1081, 1513, 825, 582,
	1060, 821, 319, 1265, 29, 903, 1591, 1217, 1588, 571,
	105, 479, 1324, 588, 70, 1486, 228, 833, 1150, 1463,
	795, 736, 1491, 243, 1138, 438, 730, 1199, 350, 232,
	297, 957, 272, 1403, 1126, 301, 667, 790, 1230, 329,
	1074, 1336, 808, 471, 1636, 591, 318, 1577, 1424, 1180,
	1401, 580, 277, 965, 535, 1127, 1404, 977, 687, 1466,
	922, 985, 497, 1194, 461, 1623, 1207, 841, 486, 798,
	1170, 1560, 207, 339, 392, 1556, 930, 422, 1494, 427,
	1602, 813, 284, 890, 873, 1326, 1635, 541, 541, 325,
	1124, 1055, 1372, 1208, 132, 513, 1119, 591, 1628, 1175,
	421, 860, 1422, 123, 1486, 129, 1479, 1579, 307, 1574,
	287, 10, 460, 283, 900, 1045, 1609, 608, 1586, 223,
	934, 784, 1278, 667, 65, 1123, 892, 1185, 1426, 593,
	433, 208, 1453, 216, 44, 1012, 346, 1523, 665, 365,
	1170, 952, 376, 1630, 1235, 988, 1037, 1205, 1597, 696,
	1428, 604, 1480, 779, 1271, 1546, 263, 236, 1162, 1566,
	535, 1205, 1612, 1582, 1216, 503, 997, 466, 1162, 1075,
	1186, 366, 780, 1594, 1133, 1562, 696, 1614, 1621, 681,
	42, 1271, 1188, 888, 1335, 554, 1088, 575, 643, 323,
	503, 1178, 1529, 188, 833, 818, 691, 191, 1284, 1565,
	1267, 831, 5, 120, 498, 1138, 1394, 1195, 825, 1377,
	1588, 867, 721, 1137, 1467, 129, 1404, 629, 417, 408,
	952, 920, 1298, 554, 820, 205, 1372, 1223, 396, 1017,
	1150, 1375, 1561, 867, 1208, 1378, 1374, 1196, 512, 1326,
	338, 1480, 551, 1201, 993, 901, 1021, 830, 1043, 1293,
	361, 435, 580, 174, 85, 336, 164, 18, 1575, 599,
	1121, 1537, 1130, 1336, 548, 1159, 787, 1635, 717, 1299,
	1322, 767, 1140, 1586, 41, 495, 848, 1062, 1037, 1603,
	429, 1398, 400, 721, 1284, 485, 1057, 1161, 215, 994,
	1472, 1048, 604, 963, 745, 865, 484, 1532, 861, 913,
	905, 256, 1392, 406, 203, 1434, 613, 1052, 569, 12,
	1016, 998, 1556, 1589, 1488, 1579, 1401, 717, 309, 1327,
	1296, 559, 1619, 1412, 905, 1556, 261, 1400, 268, 56,
	1120, 778, 201, 1448, 1139, 857, 1476, 517, 625, 834,
	452, 304, 216, 370, 1605, 65, 22, 1367, 783, 43,
	767, 440, 602, 748, 213, 1219, 377, 186, 692, 645,
	243, 1524, 1135, 156, 1045, 636, 725, 883, 865, 1350,
	1429, 1317, 15, 6, 48, 1620, 72, 1421, 1060, 567,
	1464, 189, 719, 139, 649, 644, 1071, 1026, 831, 510,
	136, 76, 1374, 434, 459, 468, 15, 562, 1040, 281,
	840, 450, 349, 1290, 1528, 1289, 1405, 802, 911, 475,
	40, 884, 360, 526, 1325, 438, 1359, 1114, 1395, 1119,
	1624, 1532, 1195, 1072, 327, 15, 1252, 54, 289, 365,
	48, 1130, 528, 109, 781, 417, 1398, 259, 931, 670,
	447, 971, 1267, 807, 1210, 953, 957, 930, 140, 714,
	410, 1476, 319, 1317, 909, 358, 1045, 235, 412, 1334,
	600, 172, 537, 840, 281, 1030, 114, 1397, 444, 1170,
	842, 577, 486, 167, 433, 692, 1437, 813, 121, 95,
	1129, 127, 1638, 1298, 1608, 1078, 537, 189, 1572, 604,
	476, 1622, 447, 615, 762, 1248, 177, 588, 718, 333,
	1470, 1560, 622, 29, 89, 1056, 721, 1526, 1581, 555,
	1333, 1071, 682, 1332, 443, 363, 483, 980, 553, 128,
	1296, 741, 111, 104, 1068, 585, 1064, 1245, 1173, 143,
	1290, 1004, 65, 273, 1034, 1505, 1041, 116, 1104, 984,
	383, 798, 128, 1176, 113, 242, 49, 1449, 73, 25,
	330, 280, 677, 823, 515, 1136, 378, 875, 519, 636,
	608, 1610, 36, 659, 55, 539, 703, 1242, 34, 159,
	1497, 1204, 766, 473, 453, 879, 715, 503, 402, 500,
	240, 444, 780, 629, 1268, 1295, 1477, 7, 243, 357,
	356, 564, 328, 104, 1223, 95, 643, 1638, 1050, 677,
	159, 908, 1593, 925, 1093, 408, 1517, 1520, 623, 280,
	382, 863, 724, 1162, 1492, 353, 531, 1043, 73, 774,
	1141, 1600, 1620, 893, 277, 924, 255, 90, 841, 1201,
	942, 1147, 716, 620, 900, 914, 979, 1624, 784, 340,
	441, 827, 1577, 74, 1103, 1342, 1452, 487, 143, 408,
	1606, 996, 81, 1299, 1601, 359, 584, 217, 161, 1137,
	1131, 1103, 646, 208, 84, 1258, 834, 775, 1243, 1619,
	1116, 1396, 807, 766, 1182, 1623, 181, 707, 471, 36,
	1115, 151, 1032, 909, 1162, 706, 980, 108, 924, 1141,
	957, 128, 606, 1315, 48, 402, 934, 891, 84, 1137,
	577, 1595, 838, 905, 365, 759, 158, 902, 63, 405,
	198, 455, 575, 469, 283, 1556, 973, 1062, 1581, 223,
	1161, 554, 1144, 288, 701, 510, 683, 347, 1401, 479,
	1196, 51, 436, 395, 956, 801, 867, 1115, 1415, 642,
	1232, 1326, 809, 168, 156, 1092, 85, 841, 228, 1378,
	1064, 1389, 6, 569, 1389, 419, 791, 433, 766, 265,
	625, 323, 316, 1061, 430, 1272, 223, 1297, 460, 1351,
	12, 53, 1038, 821, 
};

static int T2[] = {
	378, 84, 137, 1364, 466, 488, 250, 1290, 780, 755,
	353, 610, 832, 143, 1252, 346, 1427, 545, 1511, 1167,
	516, 1595, 934, 93, 260, 114, 441, 568, 560, 453,
	947, 939, 250, 796, 664, 428, 1284, 626, 1430, 137,
	1381, 144, 747, 287, 288, 73, 633, 76, 618, 218,
	955, 846, 174, 250, 651, 146, 77, 1092, 714, 637,
	1258, 1374, 1576, 1508, 243, 314, 9, 1240, 940, 1439,
	1377, 395, 1583, 198, 394, 232, 271, 468, 1441, 63,
	1637, 283, 1031, 82, 129, 662, 511, 152, 69, 1097,
	1213, 0, 1620, 603, 496, 843, 1397, 1602, 358, 210,
	770, 411, 162, 253, 738, 450, 490, 328, 631, 292,
	392, 629, 287, 1423, 424, 416, 159, 647, 280, 228,
	106, 1493, 1579, 87, 170, 436, 642, 1567, 112, 1000,
	139, 882, 1124, 13, 1135, 223, 176, 1337, 264, 807,
	1629, 368, 1148, 1628, 1503, 1572, 405, 23, 581, 398,
	1602, 687, 1603, 1542, 1378, 512, 318, 1471, 813, 648,
	412, 1218, 276, 819, 719, 602, 1456, 1400, 736, 347,
	980, 753, 258, 180, 1477, 256, 1129, 182, 516, 900,
	674, 1561, 1180, 1568, 772, 631, 441, 802, 464, 966,
	1163, 588, 546, 1439, 1119, 977, 402, 937, 738, 850,
	1284, 1430, 1603, 1542, 1610, 1153, 159, 812, 1048, 675,
	73, 83, 310, 1254, 12, 794, 1597, 166, 1596, 422,
	1132, 1120, 723, 1390, 632, 203, 728, 747, 852, 1179,
	1597, 1355, 869, 1120, 355, 91, 431, 708, 5, 1357,
	287, 444, 1178, 639, 736, 1227, 504, 727, 594, 1299,
	341, 1133, 1417, 1496, 1617, 1500, 1333, 1056, 707, 1493,
	986, 400, 1209, 216, 1232, 1276, 307, 1375, 345, 24,
	1093, 633, 468, 345, 1272, 916, 1572, 1488, 1356, 528,
	860, 58, 1373, 638, 1266, 1063, 212, 961, 481, 919,
	527, 1467, 1031, 97, 1396, 624, 1373, 64, 361, 1431,
	1440, 1454, 425, 269, 1511, 1409, 898, 1445, 21, 975,
	450, 1266, 934, 1394, 1236, 654, 1430, 1234, 1498, 12,
	839, 167, 105, 1576, 96, 1329, 623, 1401, 387, 1304,
	660, 904, 573, 1063, 794, 903, 1294, 1474, 983, 1028,
	810, 1146, 367, 1456, 613, 1603, 472, 404, 911, 331,
	417, 111, 210, 234, 1400, 306, 1275, 96, 69, 1374,
	1113, 441, 351, 47, 1217, 1145, 950, 584, 693, 6,
	1612, 1215, 864, 341, 1033, 1477, 17, 1505, 243, 928,
	1548, 372, 752, 1471, 318, 462, 328, 1300, 1584, 1073,
	177, 29, 285, 1614, 1131, 438, 1090, 1638, 397, 1300,
	339, 552, 1408, 411, 1145, 1392, 1423, 424, 1580, 416,
	1527, 1490, 99, 1462, 1163, 1276, 285, 1491, 649, 231,
	637, 827, 260, 922, 514, 1391, 1360, 1316, 1103, 1470,
	977, 1154, 95, 458, 1565, 1240, 1562, 1349, 1376, 1216,
	1478, 1264, 1067, 1577, 1088, 303, 926, 1085, 155, 1576,
	1316, 793, 476, 1289, 76, 702, 753, 1149, 379, 1568,
	692, 1356, 422, 1286, 407, 155, 1396, 869, 1357, 295,
	1448, 153, 1502, 527, 1077, 424, 1259, 1563, 1253, 1604,
	398, 1576, 535, 1052, 120, 17, 1297, 737, 670, 602,
	512, 1111, 283, 934, 758, 690, 1089, 227, 1271, 520,
	235, 1080, 673, 98, 1319, 1462, 523, 940, 1099, 1488,
	617, 1497, 1137, 1152, 622, 1257, 881, 1632, 67, 1551,
	307, 579, 1024, 590, 1226, 1494, 992, 388, 83, 624,
	620, 318, 1416, 1006, 128, 1097, 541, 363, 110, 119,
	559, 525, 1192, 1220, 723, 737, 1200, 156, 476, 736,
	57, 134, 1111, 1348, 1286, 1064, 313, 301, 1099, 857,
	1091, 896, 83, 1124, 917, 1413, 1151, 1227, 1289, 277,
	1346, 1561, 514, 611, 854, 1237, 1348, 127, 1394, 1537,
	575, 1163, 1383, 48, 873, 1030, 824, 898, 1332, 284,
	1468, 784, 1180, 1551, 1620, 458, 1037, 844, 46, 400,
	1121, 1105, 322, 1635, 77, 888, 946, 1138, 1015, 701,
	748, 1303, 1576, 492, 1351, 810, 344, 943, 843, 1531,
	193, 1633, 582, 301, 742, 533, 668, 523, 874, 788,
	1598, 1455, 1577, 358, 1475, 942, 44, 1257, 824, 960,
	1261, 1130, 162, 379, 770, 503, 1571, 826, 1158, 775,
	430, 1352, 481, 1012, 1365, 1224, 1258, 394, 108, 493,
	895, 68, 21, 545, 138, 1497, 1488, 182, 827, 385,
	1143, 449, 1516, 1017, 540, 359, 1232, 472, 897, 752,
	959, 1327, 177, 1440, 700, 1542, 737, 31, 9, 846,
	237, 904, 626, 1141, 605, 1367, 761, 406, 1365, 794,
	1614, 1307, 1405, 703, 1415, 102, 342, 1145, 443, 1434,
	774, 910, 641, 1240, 565, 640, 1123, 744, 1196, 944,
	1409, 1305, 1048, 850, 519, 1365, 578, 992, 132, 16,
	147, 1459, 1324, 1265, 523, 1100, 1367, 577, 318, 1523,
	85, 804, 794, 726, 118, 1359, 1078, 1241, 176, 347,
	258, 1585, 14, 1306, 796, 533, 1032, 1086, 1526, 877,
	1103, 34, 697, 788, 1011, 932, 1600, 452, 1221, 279,
	832, 1386, 997, 846, 1533, 1419, 1049, 1417, 904, 1410,
	215, 29, 994, 719, 1532, 659, 1208, 943, 830, 1015,
	363, 782, 747, 300, 454, 1114, 1013, 100, 1484, 1507,
	1233, 677, 966, 304, 1235, 861, 84, 358, 351, 701,
	129, 566, 730, 1123, 998, 335, 1494, 567, 991, 397,
	1294, 1354, 1180, 402, 15, 1346, 1229, 740, 1446, 1074,
	320, 753, 1463, 1286, 1057, 1059, 220, 853, 1129, 283,
	1554, 1258, 562, 358, 454, 1560, 693, 697, 1618, 130,
	71, 254, 1304, 900, 222, 286, 1329, 1107, 1326, 116,
	1273, 2, 199, 275, 782, 339, 658, 1457, 331, 922,
	609, 140, 677, 1588, 1007, 1567, 422, 607, 337, 401,
	737, 409, 368, 402, 1021, 590, 401, 711, 1410, 1439,
	540, 756, 1153, 739, 1032, 297, 1079, 51, 115, 1122,
	973, 437, 1262, 1362, 98, 342, 1002, 233, 949, 1340,
	346, 1398, 1461, 714, 1513, 843, 1017, 275, 1266, 500,
	75, 167, 1256, 1228, 
};

#define uchar unsigned char

int
def_types_hash(const uchar *key)
{
	int i;
	unsigned f0, f1, f2;
	const uchar *kp = key;

	for (i=-46, f0=f1=f2=0; *kp; ++kp) {
		if (*kp < 46 || *kp > 122)
			return -1;
		if (kp-key > 11)
			return -1;
		f0 += T0[i + *kp];
		f1 += T1[i + *kp];
		f2 += T2[i + *kp];
		i += 77;
	}

	if (kp-key < 10)
		return -1;

	f0 %= 1639;
	f1 %= 1639;
	f2 %= 1639;

	if (f1 == f0 && ++f1 >= 1639)
		f1 = 0;
	if (f2 == f0 && ++f2 >= 1639)
		f2 = 0;
	if (f1 == f2) {
		if (++f2 >= 1639)
			f2 = 0;
		if (f2 == f0 && ++f2 >= 1639)
			f2 = 0;
	}

	return g[f0] + g[f1] + g[f2];
}